﻿using System;
using System.Threading.Tasks;

namespace Sharp.Portal.Mvc.OAuth.Baidu.Provider
{
    public class BaiduAuthenticationProvider : IBaiduAuthenticationProvider
    {
        public BaiduAuthenticationProvider()
        {
            OnAuthenticated = context => Task.FromResult<object>(null);
            OnReturnEndpoint = context => Task.FromResult<object>(null);
        }

        public Func<BaiduAuthenticatedContext, Task> OnAuthenticated { get; set; }

        public Func<BaiduReturnEndpointContext, Task> OnReturnEndpoint { get; set; }

        public virtual Task Authenticated(BaiduAuthenticatedContext context)
        {
            return OnAuthenticated(context);
        }

        public virtual Task ReturnEndpoint(BaiduReturnEndpointContext context)
        {
            return OnReturnEndpoint(context);
        }
    }
}